UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Zkx4AggL+Qb8t2+42T81MGWItpReB1MAxd9rFPWJNw='
WHERE
key_id = '24eb88ba45fead4f1e5299812396f2aa09bc95321675c44b1a32b6b8c5a0d514'
AND (
token = '7Zkx4AggL+Qb8t2+42T81MGWItpReB1MAxd9rFPWJNw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)