UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'osAXMBAbu05OD/ZO7udGEn48gh7SXnkLyg7IpamB1u0='
WHERE
key_id = 'a2879d30c7fb85a9bae1dc00a397e7c8e0b3aed9b83e796b43f48a7740f22ca3'
AND (
token = 'osAXMBAbu05OD/ZO7udGEn48gh7SXnkLyg7IpamB1u0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)