UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WJ2AWVLWEkVi+Y0U6KYEcf05jkBzmH96TlF/kNYYHX4='
WHERE
key_id = 'b154165f2060aeac9394316f8e5d43b15fb5d63f6eb35f02dd1bcfbe6a575498'
AND (
token = 'WJ2AWVLWEkVi+Y0U6KYEcf05jkBzmH96TlF/kNYYHX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)