UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zMDa2oAgQVfr2+Zgf2ep25qQVoNPWOEJ2a+CTXeaVRM='
WHERE
key_id = 'c0187f3e2eb6662fc5318d398d05ebd1939ede347b2df08d29015dce8a708c19'
AND (
token = 'zMDa2oAgQVfr2+Zgf2ep25qQVoNPWOEJ2a+CTXeaVRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)