UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G59HYnxwm1LaVEm3kQmlrUW16FHmsGf80BI3JHDXETs='
WHERE
key_id = '01fae00f70b55a0ffa2f3f9dd52bf7b62a19222edf74e319b2298058e9c8ede6'
AND (
token = 'G59HYnxwm1LaVEm3kQmlrUW16FHmsGf80BI3JHDXETs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)