UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y0cpEiudpc81Ui+IfoUqliwVhvIoTLPVx3M8SonSVu8='
WHERE
key_id = '70632a5d9186f5c052b9ef46eb7040f5f1a2e7c52de4dddf54e3e0e267569e6c'
AND (
token = 'Y0cpEiudpc81Ui+IfoUqliwVhvIoTLPVx3M8SonSVu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)