UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o2lVahpsbEvxCr8TfA8+2ctWwoILjOX8NL/CiqxRsEI='
WHERE
key_id = '0e2799bdfdbbf347c1576e0c99c0a4c62da523c833773f9732f5dc35b392a439'
AND (
token = 'o2lVahpsbEvxCr8TfA8+2ctWwoILjOX8NL/CiqxRsEI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)