UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DOXSvtzyrve7kbLGJk3eJBDrRooEw1lg6y1ZMNXQ3Xw='
WHERE
key_id = 'ab31cdb0e63fe9b1e7d30cb7d5a16991b01326dfaefe57e124ddd173bc6e9b5b'
AND (
token = 'DOXSvtzyrve7kbLGJk3eJBDrRooEw1lg6y1ZMNXQ3Xw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)