UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gLukPFkDZekGGtB2DPXEnbyVWxD9K5q4G9RVGC4+Kxc='
WHERE
key_id = '77ddf426c843a1ca03827f616acd8c08d5964ae82431b22c8f57a8d5be3554cd'
AND (
token = 'gLukPFkDZekGGtB2DPXEnbyVWxD9K5q4G9RVGC4+Kxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)