UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ma9wJM6DJ8BpTui1RMcVKkIjgr6Kepjw0X6a+RCyXGs=' 
WHERE 
  key_id = '6a8628dabb4ec8760aae923f668a4bc2b8fad391dd9a6b968b9d666ead6e5bc7' 
  AND (
    token = 'Ma9wJM6DJ8BpTui1RMcVKkIjgr6Kepjw0X6a+RCyXGs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017