UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u6fNL8VnKakubfvVhbs5/TlcGL1SQRo8N5GrSRUFfVs='
WHERE
key_id = '8e1aa3d8d8ffc2f9ca65c27e4cf6eef3d819b52564c7a01c87daf58a348036a3'
AND (
token = 'u6fNL8VnKakubfvVhbs5/TlcGL1SQRo8N5GrSRUFfVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)