UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KCTD26aIgvYypcw/kKoJaabtmvkn6N6BB56yAi6aKbA='
WHERE
key_id = '3ab3f0a2678dbd8c977fd47fba5bde784531f9dc21c8215a4d1cf1f2163f8e7f'
AND (
token = 'KCTD26aIgvYypcw/kKoJaabtmvkn6N6BB56yAi6aKbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)