UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PaJeM22PekLSV9UDSSuB6jzbzB6KoluwSDA+lrY6Qgc=' 
WHERE 
  key_id = '0ed945178ea4f4292553a788ce3db13c1741f72195ea8f39bf1415533e78932b' 
  AND (
    token = 'PaJeM22PekLSV9UDSSuB6jzbzB6KoluwSDA+lrY6Qgc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029