UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Wjdc//juz2/988Qx9Ba+ZRc2u6h+vEEwrRcvGZ0AY0=' 
WHERE 
  key_id = '373b5443f1b0fb2dd5277a53b7e9e3df5a00815075276522d68537d5b0d2c593' 
  AND (
    token = '3Wjdc//juz2/988Qx9Ba+ZRc2u6h+vEEwrRcvGZ0AY0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031