UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A9w/SD5ilax6LZmTFK53bggvj4t0f6v2Z/k8bE7+9A0='
WHERE
key_id = 'dae1380ff87a1c374356cccc1b5f84a2fa7f8630b7dc4b8ca94b0f352cddd66b'
AND (
token = 'A9w/SD5ilax6LZmTFK53bggvj4t0f6v2Z/k8bE7+9A0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)