UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vurnPVMrByfbWgvLb0hb4bC8sxK7sgAXp7IbAiEIq3o=' 
WHERE 
  key_id = '5ac81d84d52dd272e706806fc4b56e840dafda5f7b4268043171669d8bd17b24' 
  AND (
    token = 'vurnPVMrByfbWgvLb0hb4bC8sxK7sgAXp7IbAiEIq3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040