UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jPUneYL+MKe/HAK/Kank4mjlkUlh/796TsQ2Iiqb1CA=' 
WHERE 
  key_id = 'a26ca766f1623f76df093a98e08af4b6d6eb22e1aeaded1133dfcd68f7431ed0' 
  AND (
    token = 'jPUneYL+MKe/HAK/Kank4mjlkUlh/796TsQ2Iiqb1CA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042