UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MqmlTTypsUANGNrPGOefEUqaFQA3Zht4Eh9GtxBpdyo=' 
WHERE 
  key_id = '4554fc8c6731a13c1d4519e2b80de1e57b23bf0b341d84cc0805b0e83d321e73' 
  AND (
    token = 'MqmlTTypsUANGNrPGOefEUqaFQA3Zht4Eh9GtxBpdyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044