UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ediPGIy2L0wnbADcrVvtHwY2w2Rt0N5TFQQwkNv+WfA=' 
WHERE 
  key_id = '35e60267cd77b6284ccf52ac9447520430e85038699a343408b47fea724369b9' 
  AND (
    token = 'ediPGIy2L0wnbADcrVvtHwY2w2Rt0N5TFQQwkNv+WfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027