UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P48o89emTBfiTI4v7lfqcynOAc3155rnF+mSwR49DwA=' 
WHERE 
  key_id = 'ddebcc397ba09a6362dfd26a78def954c37876df2c03ecec8d9b9897b8b4aa7c' 
  AND (
    token = 'P48o89emTBfiTI4v7lfqcynOAc3155rnF+mSwR49DwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046