UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nmAB7dSPIYNECk9/KNyfRk4EwKKsDDwa8/EboXDqu64='
WHERE
key_id = '05d55617232e1b4f9a7a0a7922dfad83ebef4b31f82f731422db240cb4c6986b'
AND (
token = 'nmAB7dSPIYNECk9/KNyfRk4EwKKsDDwa8/EboXDqu64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)