UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RC7u07jriXlzT5UU2bHuvWLyEsWzMZwNymAJT/RKzW4=' 
WHERE 
  key_id = '87bbfc6384c5065dd140a89646938e934a3e3b016329182fbebdbf0f6e247366' 
  AND (
    token = 'RC7u07jriXlzT5UU2bHuvWLyEsWzMZwNymAJT/RKzW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032