UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+N/atlKV53dsSEt/udlShQunVGsntR4dmPr+EV+lkRk='
WHERE
key_id = 'cda3fb2fd461065575daa26d7a144db12d6e8a077ccd23afba8a2bd85922325a'
AND (
token = '+N/atlKV53dsSEt/udlShQunVGsntR4dmPr+EV+lkRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)