UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PU0Ij3h317qABWDCZcTG1Jw/48hHNZnWYZCB0My1Yzo='
WHERE
key_id = '71e2a67382688f17bb0424315dfb9ab2d3a3be2a953e85ec85c39deb1728e631'
AND (
token = 'PU0Ij3h317qABWDCZcTG1Jw/48hHNZnWYZCB0My1Yzo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)