UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MYv0Hk6Qz479iK6GDzPnsEzxZ5TsiVVuwQnobGjnxK4=' 
WHERE 
  key_id = '14c6f514d189eb9bcc0c3f09b0d72cea22f6a1ece7b262f760c3b48aeaae343a' 
  AND (
    token = 'MYv0Hk6Qz479iK6GDzPnsEzxZ5TsiVVuwQnobGjnxK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030