UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uFCRl2CgmjgV8470m0+RDrur7JNbmqfpjVgHMzvVueI=' 
WHERE 
  key_id = '4cd6178bf26a3ba5068d8836aef7a5259d98d0773e9eaf6454851d846054072e' 
  AND (
    token = 'uFCRl2CgmjgV8470m0+RDrur7JNbmqfpjVgHMzvVueI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056