UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X1VH2ojl38q80CWmiFef2sunFW/ssVZgQtxJNqDMoRI=' 
WHERE 
  key_id = 'b12b44232efd2708c7ae78ed0ecce8dfbc5146757cab1ed35d8d616f3b373527' 
  AND (
    token = 'X1VH2ojl38q80CWmiFef2sunFW/ssVZgQtxJNqDMoRI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015