UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J2UNJ4jx74dwdHTlUj8oAmJYg0+b2Bk0uRYF+vQcWq4='
WHERE
key_id = '55203cbb032e8f536d07b5f38f126440101b8d422b240cda21ba97b6237f1176'
AND (
token = 'J2UNJ4jx74dwdHTlUj8oAmJYg0+b2Bk0uRYF+vQcWq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)