UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pJADZEk7d5qQI3TWHYE6fN0y+X3gqFUIBX50oeIqGEg='
WHERE
key_id = 'def3d102270b729000fd09a953285cfd8e2d4aff0768558fe5cb961fd1605cb6'
AND (
token = 'pJADZEk7d5qQI3TWHYE6fN0y+X3gqFUIBX50oeIqGEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)