UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dnFbZt9NfTmlhMiqTbK6Dkx8FzMIalBvPiIdCs+X7xk='
WHERE
key_id = '737e985f1f12991ad1bb1ea353822a73f83230f0414823c769a0064b3f35ccbf'
AND (
token = 'dnFbZt9NfTmlhMiqTbK6Dkx8FzMIalBvPiIdCs+X7xk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)