UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qV81HTpcCsT9DCanYXcjyie/KrMF5goZHbLAqaHCM54='
WHERE
key_id = 'cb6b89da6b5d41bba45c96ce2f42a566be47b32e09cdafc243dbe8f450237f5d'
AND (
token = 'qV81HTpcCsT9DCanYXcjyie/KrMF5goZHbLAqaHCM54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)