UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LVdBYaT9SG08Cy6dZw9ZcLT6nd9VWm3nugwdcUB9RZU=' 
WHERE 
  key_id = 'dcebb09b655b45e70e9e33e1eccc7a2ac33bfd80a6163119dacce74a28ff4bdc' 
  AND (
    token = 'LVdBYaT9SG08Cy6dZw9ZcLT6nd9VWm3nugwdcUB9RZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020