UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rPPZ4BQdTRai1UyzzaFDxJQQoW9H4RS/S1Yxk3Lxxcc='
WHERE
key_id = '4c72adb267ac13a681f48e3d40c6b0a669a8a0bdcafb2346f02c064b5f2b7ce5'
AND (
token = 'rPPZ4BQdTRai1UyzzaFDxJQQoW9H4RS/S1Yxk3Lxxcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)