UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FI6i0/CMkvtnUbw/mo4AQX6Ij566GsJcbsIzxxyw6WM='
WHERE
key_id = 'a28c4f91b878c990103855d422aaaa43f25da3331299db3fa0b2ee5c904af027'
AND (
token = 'FI6i0/CMkvtnUbw/mo4AQX6Ij566GsJcbsIzxxyw6WM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)