UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zwhzE6R2BcHBicgwwSE+0lwRF8vFMCS02ooK5KGi1tE='
WHERE
key_id = '1c0574a260a998e93017fa44b835a0e486cac1f9a3c55aa8e1ef4db1b947a457'
AND (
token = 'zwhzE6R2BcHBicgwwSE+0lwRF8vFMCS02ooK5KGi1tE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)