UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5tmQium8Vr2+D7y8P19l8SLBF2gVBV+73RI19GLK9sw=' 
WHERE 
  key_id = '3f89a6966720a6fd8fba685e9ecaf3f725d32370abe0d44af4642368d86d8e4d' 
  AND (
    token = '5tmQium8Vr2+D7y8P19l8SLBF2gVBV+73RI19GLK9sw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072