UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1t6gaDa3i/jnCF2TagwP9z5X1ONQ+1HC7av3ES4hxmA='
WHERE
key_id = '11a6c6c6e22742f53eb7ab8db3857db35f389b1de1c71ce1bb187f736abedb09'
AND (
token = '1t6gaDa3i/jnCF2TagwP9z5X1ONQ+1HC7av3ES4hxmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)