UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zdiu5j5PdPst/kkRAFHERtKKgh9+DctMnbGXSNWgSRs='
WHERE
key_id = '51fd39ebea6597c3d2295094594dd3a6b8ae1a8fef03171fc99a56df0cf75b7d'
AND (
token = 'zdiu5j5PdPst/kkRAFHERtKKgh9+DctMnbGXSNWgSRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)