UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2lwk2YxblE3oiXVBhLXu3IM3tkgzM19liF8TvxrzvIM=' 
WHERE 
  key_id = '6337a6fd9a0f9d2f68771df96fafa2cc521e3ad378da85e30a9667fc4b43267b' 
  AND (
    token = '2lwk2YxblE3oiXVBhLXu3IM3tkgzM19liF8TvxrzvIM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048