UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oHUnMfLnN/73h4/u1prvu4LyXs7TnHD5z21O53jK2QE='
WHERE
key_id = '8617ce892a879afd59494ef0ed160a05ef94f0886bc6d9092bc1a7b2772497ba'
AND (
token = 'oHUnMfLnN/73h4/u1prvu4LyXs7TnHD5z21O53jK2QE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)