UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZWjLu4Dr2FuVDa9PhR8OMDBM/aKZfj5CrQ3eTdgvhN0='
WHERE
key_id = '9b5773b79fca10c18ee8c37a63f4caf5d8f6833872cfbd19adc83d939c947369'
AND (
token = 'ZWjLu4Dr2FuVDa9PhR8OMDBM/aKZfj5CrQ3eTdgvhN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)