UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lceKVDes5RkGEaedqIlFVQELznNdsVHela6vrNO9mPE=' 
WHERE 
  key_id = '46362041b1de2301e8b196cd4bedaf6f2f9b65c026ed5297168fe53d2bd03af2' 
  AND (
    token = 'lceKVDes5RkGEaedqIlFVQELznNdsVHela6vrNO9mPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033