UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ALHcCiDj7byQ3y7WSG14/NqbfrTWpXaaQIz0uIjvWXc=' 
WHERE 
  key_id = 'ded93189b8c087c244c6b2c822699c23d740a2db7a6a25a3c83939da95ac522f' 
  AND (
    token = 'ALHcCiDj7byQ3y7WSG14/NqbfrTWpXaaQIz0uIjvWXc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019