UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dRN2KZx5Oz0P6wYuV7XnPTnoNyKQEVPJcjsM0mmCB5w=' 
WHERE 
  key_id = '5419c2a8eb76f4ae4ff299cb7c416d732bd8bce397bef10f7042a11e06755fb2' 
  AND (
    token = 'dRN2KZx5Oz0P6wYuV7XnPTnoNyKQEVPJcjsM0mmCB5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025