UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y88Pa5tMbloqescyAv7sslSbQX3Eii/HpwqPuRqi7bA=' 
WHERE 
  key_id = '121a447f91ec57fc3f752ae6ca96b80258d8b175e8aa99a24505d9d8ed8b9880' 
  AND (
    token = 'Y88Pa5tMbloqescyAv7sslSbQX3Eii/HpwqPuRqi7bA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018