UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lo9hAK5axlPWDWh1OoJUzz7xdd823IsI66vodXcVI9E='
WHERE
key_id = 'd9d1a2d4bc47d6374b785fb09dfcc106ae5d4ed0157dd032f5e774f2297420a7'
AND (
token = 'Lo9hAK5axlPWDWh1OoJUzz7xdd823IsI66vodXcVI9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)